function debounce(fn, wait) {
    var timeout = null;
    return function () {
        var ctx = this;
        var args = Array.prototype.slice.call(arguments);
        if (timeout) {
            clearTimeout(timeout);
        }
        timeout = setTimeout(function () {
            fn.apply(ctx, args);
        }, wait);
    }
}

function checkMobileAndPhone(mobile) {
    var isMob = /^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(18[0-9]{1})|(19[0-9]{1}))+\d{8})$/;
    var isPhone = /^(0[\d]{2,3}-[\d]{7,8})|(0[\d]{9,11})$/; //��ͨ����
    var isPhone2 = /^(400[\d]{6,8})|(400-[\d]{3,4}-[\d]{3,4})$/; //400����
    return isMob.test(mobile) || isPhone.test(mobile) || isPhone2.test(mobile);
}

function shallowCopy(obj) {
    var newObj = {};
    var keys = Object.keys(obj);
    for (var i = 0; i < keys.length; i++) {
        var key = keys[i];
        newObj[key] = obj[key];
    }
    return newObj;
}